﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>提单记录</title>
<link href="../../Client/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="../css/admin.css" rel="stylesheet" type="text/css" />
<script src="../js/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="../js/function.js" type="text/javascript"></script>
<script src="../js/base.js" type="text/javascript"></script>
<script src="../js/dialog.js" type="text/javascript"></script>
<script src="../js/jquery-form.js" type="text/javascript"></script>
<script src="../js/ajax-data.js" type="text/javascript"></script>
<script src="../js/Pager.js" type="text/javascript"></script>
<style>
.foot_btn_box{ text-align:left; margin-left:200px;}
li.selected {height:23px;}
.selected a:hover{ text-decoration:none;}
td input {width:300px;}
table{border-collapse: collapse;border: none;width:640px; text-align:center;}
td{border: solid #ccc 1px;color:Black; height:26px;}
td a{ text-decoration:none;}
.th{ font-weight:bold;}
</style>
</head>
<body class="mainbody">
<form id="form1" runat="server">
<div class="navigation"><a href="javascript:" class="back">后退</a>首页 &gt; 微街秀代理商 &gt; 提单记录</div>
<div id="contentTab">
    <ul class="tab_nav">
        <li><a id="tab1" href="javascript:;">基本信息</a></li>
        <li><a id="tab2" href="javascript:">小计列表</a></li>
        <li ><a id="tab3" href="javascript:">提单记录</a></li>
    </ul>

    <div class="tab_con" style="display:block;">
        <div style="height:30px;display:none;">
            提单时间:<input type="text" id="time1" name="time1" style="width:80px;" />
            至:<input type="text" id="time2" name="time2"  style="width:80px;" />
            <input type="button" id="btn" value="搜 索" onclick="submits()" />
        </div>
        <div style="font-size:14px; height:30px;">
            代理商：<span id="sitename"></span>
        </div>
         <table>
            <tr class="th">
                <td>日期</td>
                <td>单笔金额</td>
                <td>余额</td>
                <td>类型</td>
                <td>备注</td>
            </tr>
            <tbody id="list"></tbody>
        </table>
        
         <div class="pager_style">
            <ul class="page_num"></ul>
            <ul class="page_info">
                <li>总数:<span id="count">0</span></li>
                <li>每页:<span id="pageSize">0</span></li>
                <li>页数:<span id="pageToal">0</span></li>
            </ul>
        </div>
    </div>
    <div class="foot_btn_box">
    <input type="button" value=" 返回列表 " onclick="window.location.href='list.html'" />
    </div>
</div>
</form>
<script>
    $(function () {
        var sitename = decodeURIComponent(getUrlArgStr("sitename"));
        $("#sitename").html(sitename);
        $("#tab1").attr("href", "detail.html?agentid=" + getUrlArgStr("agentid") + "&sitename=" + sitename + "#tab0");
        $("#tab2").attr("href", "detail.html?agentid=" + getUrlArgStr("agentid") + "&sitename=" + sitename + "#tab1");
        $("#tab3").attr("href", "list_jilu.html?agentid=" + getUrlArgStr("agentid") + "&sitename=" + sitename);
        GetList(1);
    })

    function GetList(page) {
        var agentid = getUrlArgStr("agentid");
        var time1 = $("#time1").val();
        var time2 = $("#time2").val();
        var param = "agentid=" + agentid + "&page=" + page + "&time1="+time1+"&time2="+time2;

        AjaxStart("../ajax/agent.ashx?getlist_recoad", param, function (data) {
            if (data.code != 0) {
                $("#list").html(html + "<tr><td colspan='9'>" + data.msg + "</td></tr>");
            }
            else {
                $("#list").html("");
                var list = data.item.table;
                if (list.length == 0)
                    $("#list").append("<td colspan='5' style='height:60px;'>没有记录</td>");
                for (var i in list) {
                    var d = "";
                    if (list[i].direction == 1)
                        d = "收入"
                    else if (list[i].direction == 2)
                        d = "支出";
                    $("#list").append("<tr id = " + list[i].id + "><td>" + list[i].addtime.replace("T"," ") + "</td>" +
                    "<td>" + (list[i].direction == 2 ? (list[i].amount * -1) : list[i].amount) + "</td>" +
                    "<td>" + list[i].balance + "</td>" +
                    "<td class='col4'>" + d + "</td>" +
                    "<td>" + list[i].remarks + "</td></tr>");
                }
                var pager = new Pager();
                $(".page_info").css("display", "block")
                pager.initPage(page, data.item.itemCount, 20, 5, GetList);
            }
        });
    }
    function submits() {
        GetList(1);
    }
 </script>
</body>
</html>
